//导入vue核心包
import Vue from 'vue';

//导入app。vue的vue对象
import App from './App.vue';

// 将vue-router导入
import vueRoute from 'vue-router';

//注册mit-ui组件
import 'mint-ui/lib/style.min.css';
//导入 mui的css
import '../statics/mui/css/mui.css';

//当前系统的全局基本颜色
import	'../statics/css/site.css';

import Mint from 'mint-ui';



//配置到实例中
Vue.use(Mint);
Vue.use(vueRoute);

import home from './components/home.vue';
import shopcar from './components/shopcar/car.vue';
import newslist from './components/news/newslist.vue';
import newsinfo from './components/news/newsinfo.vue';
import photolist from './components/photo/photolist.vue';
import photoinfo from './components/photo/photoinfo.vue';
import goodslist from './components/goods/goodslist.vue';
import goodsinfo from './components/goods/goodsinfo.vue';
import goodsdesc from './components/goods/goodsdesc.vue';
import goodscomment from './components/goods/goodscomment.vue';

var router = new vueRoute({
	linkActiveClass:'mui-active', //改变路由激活时的calss
	routes:[
		{path:'/',redirect:'/home'}, //设置默认跳转
		{path:'/home',component:home}, //主页
		{path:'/shopcar/car',component:shopcar}, //购物车
		{path:'/news/newslist',component:newslist}, // 新闻资讯
		{path:'/news/newsinfo/:id',component:newsinfo}, //新闻资讯详情
		{path:'/photo/photolist',component:photolist}, //图片分享
		{path:'/photo/info/:id',component:photoinfo}, //图片详情
		{path:'/goods/goodslist',component:goodslist},//商品列表
		{path:'/goods/goodsinfo/:id',component:goodsinfo},//商品详情
		{path:'/goods/goodsdesc/:id',component:goodsdesc},//商品介绍
		{path:'/goods/goodscomment/:id',component:goodscomment}//商品评论
	]
});

// 7.0 将vue-resource在vue中绑定，自动在vue实例对象上注入一个$http对象
import vueResource from 'vue-resource';
Vue.use(vueResource);


// 将vue-preview组件添加在vue实例中
import VuePreview from 'vue-preview';
Vue.use(VuePreview);

//8.0实现日期格式化的过滤器
import moment from 'moment';
Vue.filter('datefmt',(input,fmtstring)=>{
	return moment(input).format(fmtstring);
})

//利用vue对象进行解析渲染
new Vue({
	el: '#app',
	router,
	render: c => c(App)
})